﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcps.Web
{
    public partial class ArticleType : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request["type"]))
                {
                    Bind(Request["type"]);
                }
            }
        }

        private void Bind(string type)
        {

            if (type == "1")
            {
                this.lbl_type.Text = "物资供应管理规章制度";
            }

            if (type == "2")
            {
                this.lbl_type.Text = " 履约班组建设";
            }

            if (type == "3")
            {
                this.lbl_type.Text = "管理创新";
            }


            lcps.BLL.article ab = new BLL.article();

            DataSet ds = ab.GetList(" contentType='" + type + "' ");

            if (ds.Tables[0].Rows.Count > 0)
            {
                string gzzdl = "<ul>";

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string time = Convert.ToDateTime(ds.Tables[0].Rows[i]["pubtime"].ToString()).ToShortDateString();

                    gzzdl += "<li>";
                    gzzdl += "<span class='art_right'>" + time + "</span>";
                    gzzdl += "<a href='ShowArticle.aspx?id=" + ds.Tables[0].Rows[i]["id"] + "&type="+type+"' target='_blank'>" + ds.Tables[0].Rows[i]["title"] + "</a>";
                    gzzdl += "</li>";

                }

                

                gzzdl += "</ul>";
      
                this.Literal1.Text = gzzdl;
            
            }

        }
    }
}